package rmi;

import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;
/**
 * ��FileImpl��UnicastRemoteObject��չ��������ʾ��FileImpl������������һ�������ģ����ܸ��Ƶģ�Զ�̵Ķ���
 * �������ʹ��RMI ��Ĭ�ϵĻ���TCP��ͨ�ŷ�ʽ��
 * @author Administrator
 *
 */
public class RemoteInterfaceImpl extends UnicastRemoteObject implements
		RemoteInterface {

	private static final long serialVersionUID = 1L;

	public RemoteInterfaceImpl() throws RemoteException {
		super();
	}

	@Override
	public Employees getEmployeesById(String id) throws RemoteException {
		Employees employees = new Employees();
		employees.setId(id);
		employees.setName("�Ի�_" + id);
		return employees;
	}

	@Override
	public String getServerInfo(int index) throws RemoteException {
		if (index == 5)
			throw new RemoteException("Զ���׳����쳣");
		return "Զ�̷�������RMI���Գ���_" + index;
	}

}
